// src/app.module.ts
import { Module } from "@nestjs/common";
import { TypeOrmModule } from "@nestjs/typeorm";
import { User } from "./src/entities/user";
import { UserService } from "./src/services/user";
import { UserController } from "./src/controllers/user";

@Module({
  imports: [
    TypeOrmModule.forRoot({
      type: "mysql", // 根据你的数据库类型调整
      host: "localhost",
      port: 3306,
      username: "root",
      password: "xy234712",
      database: "db1",
      entities: [User],
      synchronize: true,
    }),
    TypeOrmModule.forFeature([User]),
  ],
  providers: [UserService],
  controllers: [UserController],
})
export class AppModule {}